# -*- coding:utf-8 -*-#
# 作者：bella
# 日期：2021/1/13 19:35

list = [1,2,3,4]
newlist = []
for i in list:
    for j in list:
        if j!=i:
            for k in list:
                if k not in (i,j):
                    newlist.append(int(str(i)+str(j)+str(k)))
# print(newlist)

print('组成{}个组合'.format(len(newlist)))
sum = 0
for i in newlist:
    sum += i
# print('总额为：{}'.format(sum))
avg = sum/len(newlist)
print('平均值为：{}'.format(avg))





